
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
<!DOCTYPE html>
<html>
    <head>
        <sj:head />
        <title>Search User</title>
        <script src="js/jquery.cookie.js"></script>
        <script src="js/coms.js"></script>
        <script src="js/bootstrap.min.js"></script>
    </head>
    <body>
          <s:include value="/jsp/header.jsp">
            <s:param name="user" value="#session.user.username" />
        </s:include>
        <div class="container-fluid">
            <div class="row-fluid">
                <div class="span3">
                    <s:action name="selectMenu" executeResult="true"/>
                </div>
                <div class="span9">
                    <div class="hero-unit">
        <s:form  action="searchUser_">
            <table align="center" cellpadding="5">

                <tr>
                    <td><s:text name="fieldLabel.username"/></td>
                    <td ><s:textfield name="user.username" size="40" maxlength="40"/> </td>
                </tr>

                <tr>
                    <td><s:text name="fieldLabel.emailAddress"/></td>
                    <td ><s:textfield name="user.emailAddress" size="40" maxlength="40"/> </td>
                </tr>
                
                 <tr>
                    <td><s:text name="fieldLabel.firstName"/></td>
                    <td ><s:textfield name="user.profile.firstName" size="40" maxlength="40"/> </td>
                </tr>

                <tr>
                    <td><s:text name="fieldLabel.lastName"/></td>
                    <td ><s:textfield name="user.profile.lastName" size="40" maxlength="40"/> </td>
                </tr>

                <tr>
                    <td colspan="2">
                        <s:submit label="button.label.search"/>
                    </td>
                </tr>
            </table>
        </s:form>

            <table align="center" cellpadding="5">
                 <tr style="background:#0088cc">
                    <th><s:text name="fieldLabel.username"/></th>
                    <th><s:text name="fieldLabel.emailAddress"/></th>
                    <th><s:text name="fieldLabel.firstName"/></th>
                    <th><s:text name="fieldLabel.lastName"/></th>
                    <th><s:text name="fieldLabel.gender"/></th>
                    <th><s:text name="fieldLabel.mobileNumber"/></th>
                    <th><s:text name="fieldLabel.address"/></th>
                     <s:if test="%{admin}">
                    <th>Action</th>
                    </s:if>
                </tr>

                <s:iterator value="userList" status="userStatus">
                    <s:if test="#userStatus.even == true">
                        <tr style="background: #f2f4fe">
                        </s:if>
                        <s:else>
                        <tr style="background: #dae2fc">
                        </s:else>
                        <td> <s:property value="username"/></td>
                        <td> <s:property value="emailAddress"/></td>
                        <td> <s:property value="profile.firstName"/></td>
                        <td> <s:property value="profile.lastName"/></td>
                        <td> <s:property value="profile.genderStr"/></td>
                          <td> <s:property value="profile.mobileNumber"/></td> 
                          <td> <s:property value="profile.address"/></td>
                          
                          
                           <s:if test="%{admin}">
                                    <td> 
                                        <div class="btn-group">
                                            <a class="btn btn-primary" href="#"><i class="icon-th-large icon-white"></i> </a>
                                            <a class="btn btn-primary dropdown-toggle" data-toggle="dropdown" href="#"><span class="caret"></span></a>
                                            <ul class="dropdown-menu">
                                                <li><a href="<s:url action="editUser_%{id}" />"><i class="icon-pencil"></i> <s:text name="label.edit"/></a></li>
                                                <li><a href="<s:url action="deleteUser_%{id}" />"><i class="icon-trash"></i> <s:text name="label.delete"/></a></li>
                                                <li><a href="<s:url action="sendUser_%{id}" />"><i class="icon-envelope"></i> <s:text name="label.email"/></a></li>
                                               
                                            </ul>
                                        </div>
                                    </td> 
                                    </s:if>
                          
                         </tr>
                </s:iterator>
            </table>

              </div>
                    <div class="row-fluid">



                    </div>
                </div>
            </div>
        </div>
        <s:include value="/jsp/footer.jsp"/>
    </body>
</html>
